function request(url,data = {},cookie){
    return new Promise((resolve, reject)=>{
        wx.request({
          url: 'http://localhost:3000'+ url,
          data: {},
          methods: '',
          header: {
            cookie
          },
          success:  (res)=>{
            if(data.login){
               wx.setStorageSync({
                key: 'cookies',
                data: res.cookies[0]
              })
            }
            resolve(res.data)
          }
        })
    })
}
export default request = request
